/*
This file replicates the empirical tables and figures in:

States Living in Glasshouses...: Why Fighting Domestic Insurgency Changes How Countries Vote in the UN Human Rights Council
Conflict Management & Peace Science
https://doi.org/10.1177/07388942231198489

(Last updated 26 September 2023)

Authors: Shubha K. Prasad, Irfan Nooruddin

This replication do-file references the following data-files:

1) prasad&nooruddin.cmps.replication unhrc targeted data.dta

2) prasad&nooruddin.cmps.replication unhrc general data.dta

3) prasad&nooruddin.cmps.replication unga votes data.dta

*/

cd // Change working directory to wherever all the data-files are saved
set more off 

********************************************************************************
**MAIN TEXT
********************************************************************************

//cd 

use "prasad&nooruddin.cmps.replication unhrc targeted data.dta", clear

*Main Models*

*Table 1: Relationship Between Insurgencies and Voting Behavior*

logit dvote conflict Israel c_year, cluster(vid) // Model 1 "Basic"

logit dvote conflict Israel Idealpoint US p5 EU oicvoting g77 polityivscore drchange hrcmembe coldwar trade vist c_year, cluster(vid) // Model 2 "Full"

logit dvote conflict Idealpoint US p5 EU oicvoting g77 polityivscore drchange hrcmembe coldwar trade vist c_year if tid!=666, cluster(vid) // Model 3 "No Israel Resolutions"


*Table 2: Interaction Between Insurgency and Media Censorship*

logit dvote i.conflict Israel i.conflict#i.v2mecenefm_dummy i.v2mecenefm_dummy c_year, cluster(vid) // Model 1 "Basic"

logit dvote i.conflict i.conflict#i.v2mecenefm_dummy Israel Idealpoint US p5 EU oicvoting g77 i.v2mecenefm_dummy drchange hrcmembe coldwar trade  vist c_year, cluster(vid) // Model 2 "Full"
 
logit dvote i.conflict i.conflict#i.v2mecenefm_dummy i.v2mecenefm_dummy Idealpoint US p5 EU oicvoting  drchange hrcmembe coldwar trade g77 vist c_year if tid!=666, cluster(vid) // Model 3 "No Israel Resolutions"
 

*Figure 1: Predictive Margins of Insurgency with 95% Confidence Intervals*


logit dvote i.conflict i.conflict#i.v2mecenefm_dummy Israel Idealpoint US p5 EU oicvoting  i.v2mecenefm_dummy drchange hrcmembe coldwar trade  vist c_year, cluster(vid)
 
set scheme s1mono
margins conflict, over (v2mecenefm_dummy) 
marginsplot, ytitle("Pr(Voting Yes)") xtitle("Insurgency")  
 
 
 ******
 
 //ttest with DeMeritt and Conrad Shaming data (Theoretical Argument)
 //See page 4 of PDF in paragraph starting "This fear of being shamed..."

 ttest shame_physintviol, by(conflict)
 
 //ttest for Human Rights Index (CIRI) (Data)
 //See page 8 of PDF in paragraph starting "Finally, note that we do not include controls..."
 
 ttest hrscore, by(conflict)


************************** 

*********APPENDIX*********

//A.1 Main models - mlogit
//Table A1.1: Robustness Check with Vote as Three Categories (Yes, Abstain, No)

mlogit vote conflict Israel c_year, base(2) cluster(vid)  // Model 1
mlogit vote conflict Israel Idealpoint US p5 EU oicvoting g77 polityivscore drchange hrcmembe coldwar trade vist c_year, base(2) cluster(vid)  // Model 2
mlogit vote conflict Idealpoint US p5 EU oicvoting g77 polityivscore drchange hrcmembe coldwar trade vist c_year if tid!=666, base(2) cluster(vid) // Model 3


//A.2 Main models with different measures of conflict
*Table A2.1: Robustness Check with Number of Conflicts

logit dvote num_conflict Israel c_year, cluster(vid) // Model 1
logit dvote num_conflict Israel Idealpoint US p5 EU oicvoting g77 polityivscore drchange hrcmembe coldwar trade vist c_year, cluster(vid) // Model 2
logit dvote num_conflict Idealpoint US p5 EU oicvoting g77 polityivscore drchange hrcmembe coldwar trade  vist c_year if tid!=666, cluster(vid) // Model 3

*Table A2.2: Robustness Check with Cumulative Intensity of Conflict
*cumulative intensity: 0 for no conflict, 1 if conflict hasn't reached 1000 battle deaths, 2 if it's reached another 1000 battle deaths

logit dvote num_cumulativeintensity Israel c_year, cluster(vid) // Model 1
logit dvote num_cumulativeintensity Israel Idealpoint US p5 EU oicvoting g77 polityivscore drchange hrcmembe coldwar trade  vist c_year, cluster(vid) // Model 2
logit dvote num_cumulativeintensity Idealpoint US p5 EU oicvoting g77 polityivscore drchange hrcmembe coldwar trade vist c_year if tid!=666, cluster(vid) // Model 3

*Table A2.3: Robustness with Amount of Time Spent Dealing with an Insurgency

logit dvote conyear Israel c_year, cluster(vid) // Model 1
logit dvote conyear Israel Idealpoint US p5 EU oicvoting g77 polityivscore drchange hrcmembe coldwar trade vist c_year, cluster(vid) // Model 2
logit dvote conyear Idealpoint US p5 EU oicvoting g77 polityivscore drchange hrcmembe coldwar trade vist c_year if tid!=666, cluster(vid) // Model 3

logit dvote percent_conflict Israel c_year, cluster(vid) // Model 4
logit dvote percent_conflict Israel Idealpoint US p5 EU oicvoting g77 polityivscore drchange hrcmembe coldwar trade  vist c_year, cluster(vid) // Model 5
logit dvote percent_conflict Idealpoint US p5 EU oicvoting g77 polityivscore drchange hrcmembe coldwar trade vist c_year if tid!=666, cluster(vid) // Model 6

*Table A2.4: Robustness Check with CSO Anti-System Movements
*VDem CSO anti-system movement variable

logit dvote v2csantimv_ord Israel c_year, cluster(vid) // Model 1
logit dvote v2csantimv_ord Israel Idealpoint US p5 EU oicvoting g77 polityivscore drchange hrcmembe coldwar trade vist c_year, cluster(vid)  // Model 2
logit dvote v2csantimv_ord Idealpoint US p5 EU oicvoting g77 polityivscore drchange hrcmembe coldwar trade vist c_year if tid!=666, cluster(vid)  // Model 3

*Table A2.5: Robustness Check with Separatist/Autonomist Movements
*VDem Separatist Movements

logit dvote v2csanmvch_9 Israel c_year, cluster(vid) // Model 1
logit dvote v2csanmvch_9 Israel Idealpoint US p5 EU oicvoting g77 polityivscore drchange hrcmembe coldwar trade vist c_year, cluster(vid) // Model 2
logit dvote v2csanmvch_9 Idealpoint US p5 EU oicvoting g77 polityivscore drchange hrcmembe coldwar trade vist c_year if tid!=666, cluster(vid) // Model 3

*Table A2.6: Robustness Check with Self-Determination Movements
*Sambanis Self-Determination data

logit dvote SD2_violent Israel c_year, cluster(vid) // Model 1
logit dvote SD2_violent Israel Idealpoint US p5 EU oicvoting g77 polityivscore drchange hrcmembe coldwar trade vist c_year, cluster(vid) // Model 2
logit dvote SD2_violent Idealpoint US p5 EU oicvoting g77 polityivscore drchange hrcmembe coldwar trade  vist c_year if tid!=666, cluster(vid) // Model 3


//A.3 Main models with different measures of democracy (VDem)
*Table A3.1: Alternative Measures of Democracy

*egalitarian democracy index
logit dvote conflict Israel Idealpoint US p5 EU oicvoting g77 v2x_egaldem drchange hrcmembe coldwar trade  vist c_year, cluster(vid) // Model 1
*civil liberties index
logit dvote conflict Israel Idealpoint US p5 EU oicvoting g77 v2x_civlib drchange hrcmembe coldwar trade  vist c_year, cluster(vid) // Model 2
*political civil liberties index
logit dvote conflict Israel Idealpoint US p5 EU oicvoting g77 v2x_clpol drchange hrcmembe coldwar trade  vist c_year, cluster(vid) // Model 3
*electoral democracy index
logit dvote conflict Israel Idealpoint US p5 EU oicvoting g77 v2x_polyarchy drchange hrcmembe coldwar trade  vist c_year, cluster(vid) // Model 4
*liberal democracy index
logit dvote conflict Israel Idealpoint US p5 EU oicvoting g77 v2x_libdem drchange hrcmembe coldwar trade  vist c_year, cluster(vid) // Model 5
*participatory democracy index
logit dvote conflict Israel Idealpoint US p5 EU oicvoting g77 v2x_partipdem drchange hrcmembe coldwar trade vist c_year, cluster(vid) // Model 6


//A.4 Main models with different measures of trade (UNComtrade)
*Table A4.1: Robustness Check with UNComtrade Data

*imports
logit dvote conflict Israel Idealpoint US p5 EU oicvoting g77 polityivscore drchange hrcmembe imports  vist c_year, cluster(vid) // Model 1
logit dvote conflict Idealpoint US p5 EU oicvoting g77 polityivscore drchange hrcmembe imports vist c_year if tid!=666, cluster(vid) // Model 2

*exports
logit dvote conflict Israel Idealpoint US p5 EU oicvoting g77 polityivscore drchange hrcmembe exports  vist c_year, cluster(vid) // Model 3
logit dvote conflict Idealpoint US p5 EU oicvoting g77 polityivscore drchange hrcmembe exports vist c_year if tid!=666, cluster(vid) // Model 4

*total
logit dvote conflict Israel Idealpoint US p5 EU oicvoting g77 polityivscore drchange hrcmembe untrade  vist c_year, cluster(vid) // Model 5
logit dvote conflict Idealpoint US p5 EU oicvoting g77 polityivscore drchange hrcmembe untrade vist c_year if tid!=666, cluster(vid) // Model 6



//A.5 Continuous Media Censorship Variable (VDem)
*Table A5.1: Interaction Between Insurgency and Media Censorship 

logit dvote i.conflict Israel i.conflict#c.v2mecenefm c.v2mecenefm c_year, cluster(vid) // Model 1

logit dvote i.conflict i.conflict#c.v2mecenefm Israel Idealpoint US p5 EU oicvoting g77 c.v2mecenefm drchange hrcmembe coldwar trade  vist c_year, cluster(vid) // Model 2
 
logit dvote i.conflict i.conflict#c.v2mecenefm c.v2mecenefm Idealpoint US p5 EU oicvoting g77 drchange hrcmembe coldwar trade  vist c_year if tid!=666, cluster(vid)  // Model 3


//A.6 Authoritarian Interaction term
*Table A6.1: Interaction Between Insurgency and Regime Type

logit dvote i.conflict Israel i.conflict#i.polityivscore i.polityivscore c_year, cluster(vid) // Mdoel 1
logit dvote i.conflict Israel Idealpoint US p5 EU oicvoting g77 i.conflict#i.polityivscore i.polityivscore drchange hrcmembe coldwar trade  vist c_year, cluster(vid) // Mdoel 2
logit dvote i.conflict Idealpoint US p5 EU oicvoting g77 i.conflict#i.polityivscore i.polityivscore drchange hrcmembe coldwar trade  vist c_year if tid!=666, cluster(vid)  // Mdoel 3


*Figure A6.1: Predictive Margins of Insurgency with 95% Confidence Intervals

logit dvote i.conflict Israel Idealpoint US p5 EU oicvoting g77 i.conflict#i.polityivscore i.polityivscore drchange hrcmembe coldwar trade  vist c_year, cluster(vid) //Model 2

margins conflict, over (polityivscore) 
marginsplot, ytitle("Pr(Voting Yes)") xtitle("Insurgency") 
 

//A.7 Comparison Between the Commission and the Council
*Table A7.1: Comparison Between Commission and Council

logit dvote conflict Israel c_year if year<2006, cluster(vid) // Model 1
logit dvote conflict Israel Idealpoint US p5 EU oicvoting g77 polityivscore drchange hrcmembe coldwar trade  vist c_year if year<2006, cluster(vid) // Model 2
logit dvote conflict Idealpoint US p5 EU oicvoting g77 polityivscore drchange hrcmembe coldwar trade vist c_year if year<2006 & tid!=666, cluster(vid) // Model 3

logit dvote conflict Israel c_year if year>=2006, cluster(vid) // Model 4
logit dvote conflict Israel Idealpoint US p5 EU oicvoting g77 polityivscore drchange hrcmembe trade  vist c_year if year>=2006, cluster(vid) // Model 5
logit dvote conflict Idealpoint US p5 EU oicvoting g77 polityivscore drchange hrcmembe trade vist c_year if year>=2006 & tid!=666, cluster(vid) // Model 6


 
//A.8 GENERAL RESOLUTIONS vs. TARGETED RESOLUTIONS 
*Table A8.1: Comparison Between Targeted and General Resolutions

*UNHRC
*targeted res
logit dvote conflict Idealpoint US p5 EU oicvoting g77 polityivscore drchange hrcmembe trade  vist c_year if year>=2006 & tid!=666, cluster(vid) 

*general res
 use "prasad&nooruddin.cmps.replication unhrc general data.dta", clear

logit dvote conflict  Idealpoint US p5 EU oicvoting g77 polityivscore drchange totaltrade  c_year if Type == "Procedural" | Type == "Thematic - Economic, Social and Cultural Rights" | Type == "Thematic - Civil and Political Rights" | Type == "Thematic - Cross-Cutting/Other" | Type == "Thematic - Groups in Focus" , cluster(vid) 

 
*Table A8.2: UNGA Votes for HR Resolutions

*use UNGA dataset
use "prasad&nooruddin.cmps.replication unga votes data.dta", clear
 

logit dvote conflict c_year if hr==1, cluster(vid) // Model 1

logit dvote conflict US p5 EU oicvoting polityivscore drchange coldwar totaltrade c_year if hr==1, cluster(vid) // Model 2
 

//A.9 Human Rights Measures
*Table A9.1: Models with Human Rights Measures
 
use "prasad&nooruddin.cmps.replication unhrc targeted data.dta", clear
 
*VDem
logit dvote conflict v2x_clphy Israel Idealpoint US p5 EU oicvoting g77 polityivscore drchange hrcmembe coldwar trade  vist c_year, cluster(vid) // Model 1
logit dvote conflict v2x_clphy Israel Idealpoint US p5 EU oicvoting g77 polityivscore drchange hrcmembe coldwar trade  vist c_year if tid!=666, cluster(vid) // Model 2

*CIRI 
logit dvote conflict hrscore Israel Idealpoint US p5 EU oicvoting g77 polityivscore drchange hrcmembe coldwar trade  vist c_year, cluster(vid) // Model 3
logit dvote conflict hrscore Idealpoint US p5 EU oicvoting g77 polityivscore drchange hrcmembe coldwar trade vist c_year if tid!=666, cluster(vid) // Model 4

*PTS scale of AMNESTY Reports
logit dvote conflict PTS_A Israel Idealpoint US p5 EU oicvoting g77 polityivscore drchange hrcmembe coldwar trade vist c_year, cluster(vid) // Model 5
logit dvote conflict PTS_A Idealpoint US p5 EU oicvoting g77 polityivscore drchange hrcmembe coldwar trade vist c_year if tid!=666, cluster(vid) // Model 6

*latent HR
logit dvote conflict theta_mean Israel Idealpoint US p5 EU oicvoting g77 polityivscore drchange hrcmembe coldwar trade vist c_year, cluster(vid) // Model 7
logit dvote conflict theta_mean Idealpoint US p5 EU oicvoting g77 polityivscore drchange hrcmembe coldwar trade vist c_year if tid!=666, cluster(vid) // Model 8

 
//A.10 Controlling for Foreign Aid Relationship between Voting State and Targeted State
use "prasad&nooruddin.cmps.replication unhrc targeted data.dta", clear

*Table A10.1: Adding Foreign Aid as a Control
 
logit dvote conflict sharegdpconstant_vid Israel US coldwar Idealpoint EU oicvoting g77 p5 trade polityivscore drchange hrcmembe vist c_year, cluster(vid) // Model 1                  
logit dvote conflict sharegdpconstant_vid US coldwar Idealpoint EU oicvoting g77 p5 trade polityivscore drchange hrcmembe vist c_year if tid!=666, cluster(vid) // Model 2

*Table A10.2: Robustness for Target Dependent on Foreign Aid

logit dvote conflict sharegdpconstant_tid Israel US coldwar Idealpoint EU oicvoting g77 p5 trade polityivscore drchange hrcmembe vist c_year, cluster(vid) // Model 1                  
logit dvote conflict sharegdpconstant_tid US coldwar Idealpoint EU oicvoting g77 p5 trade polityivscore drchange hrcmembe vist c_year if tid!=666, cluster(vid) // Model 2

 
 
** END

// Please e-mail in62@georgetown.edu and prasad@hertie-school.org if you find any errors or have any feedback. Thank you for engaging our research.

